// This source is subject to the Microsoft Public License.
// See http://www.microsoft.com/resources/sharedsource/licensingbasics/sharedsourcelicenses.mspx.
// All other rights reserved.

using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.IO;
using System.Reflection;
using System.Web;
using System.Web.SessionState;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;


namespace QuoteAdvantage
{
	/// <summary>
	/// Summary description for Support.
	/// </summary>
   public class Support : System.Web.UI.Page
	{
      protected System.Web.UI.WebControls.Label lblProductName;
      protected System.Web.UI.WebControls.Label Label5;
      protected System.Web.UI.WebControls.Label lblInfragistics1;
      protected System.Web.UI.WebControls.Label lblInfragistics2;
      protected System.Web.UI.WebControls.Label lblAssemblyName4;
      protected System.Web.UI.WebControls.Label lblXheo;
      protected System.Web.UI.WebControls.HyperLink lnkErrorFreeOrders;
      protected System.Web.UI.WebControls.Label Label10;
      protected System.Web.UI.WebControls.Label lblXheoDLLName;
      protected System.Web.UI.WebControls.Label lblQuoteAdvantageVersion;
      protected System.Web.UI.WebControls.Label lblQuoteAdvantage;
      protected System.Web.UI.WebControls.Label lblInfragisticsShared;
      protected System.Web.UI.WebControls.Label Label2;
      protected System.Web.UI.WebControls.Label organizationLabel;
      protected System.Web.UI.WebControls.Label Label1;
      protected System.Web.UI.WebControls.Label Label7;
      protected System.Web.UI.WebControls.Label Label11;
      protected System.Web.UI.WebControls.Label serialNumberLabel;
      protected System.Web.UI.WebControls.Label Label13;
      protected System.Web.UI.WebControls.Label licensedUsersLabel;
      protected System.Web.UI.WebControls.Label activatedLabel;
      protected System.Web.UI.WebControls.Panel purchasedPanel;
      protected System.Web.UI.WebControls.Label Label6;
      protected System.Web.UI.WebControls.Label durationLabel;
      protected System.Web.UI.WebControls.Label Label8;
      protected System.Web.UI.WebControls.Label Label14;
      protected System.Web.UI.WebControls.Label Label15;
      protected System.Web.UI.WebControls.Label startedLabel;
      protected System.Web.UI.WebControls.Label Label16;
      protected System.Web.UI.WebControls.Label expirationLabel;
      protected System.Web.UI.WebControls.Label trialLabel;
      protected System.Web.UI.WebControls.Panel trialPanel;
      protected System.Web.UI.WebControls.Label lblLicensingErrorDetails;
      protected System.Web.UI.WebControls.Label lblCopyrightNotice;
      protected System.Web.UI.WebControls.Label lblLicensing;
      protected System.Web.UI.WebControls.Label lblSupportPage;
   
		private void Page_Load(object sender, System.EventArgs e)
		{
         /*
          * // File Write TEST
         Assembly    objSelf = Assembly.GetExecutingAssembly();
         
         string strPath = objSelf.CodeBase.Replace("file:///", "");
         FileInfo fi = new FileInfo(strPath);
         string strCurrentDir = fi.DirectoryName;
         strCurrentDir = strCurrentDir.Replace("bin", "Licensing");
         StreamWriter sw = new StreamWriter(strCurrentDir + "\\Test.txt");
         sw.WriteLine("This is a test.");
         sw.Close();
            */

         if (!this.IsPostBack)
         {
            lblQuoteAdvantageVersion.Text = FindVersion("QuoteAdvantage");
            lblInfragistics1.Text = FindVersion("Infragistics.WebUI.Shared.v6.1");
            lblInfragistics2.Text = FindVersion("Infragistics.WebUI.UltraWebNavigator.v6.1");
         }
		}

		#region Web Form Designer generated code
		override protected void OnInit(EventArgs e)
		{
			//
			// CODEGEN: This call is required by the ASP.NET Web Form Designer.
			//
			InitializeComponent();
			base.OnInit(e);
		}
		
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{    
         this.Load += new System.EventHandler(this.Page_Load);

      }
		#endregion


      private string FindVersion(string strAssemblyName)
      {
         string      strResult;
         Assembly    objAssembly = null;

         try
         {
            objAssembly = Assembly.Load(strAssemblyName);
            strResult = objAssembly.GetName().Version.ToString();
         }
         catch (Exception)
         {
            strResult = "Warning - Missing Assembly";
         }

         return strResult;
      }


	}  // end class
}
